//
//  HouseListTableViewCell.m
//  Fangmm
//
//  Created by ChaoZhou on 16/3/1.
//  Copyright © 2016年 com.fangmm. All rights reserved.
//

#import "HouseListTableViewCell.h"

@implementation HouseListTableViewCell {
    
    __weak IBOutlet UIView *priceView;
}

- (void)awakeFromNib
{
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:priceView.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRight cornerRadii:CGSizeMake(20, 20)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = priceView.bounds;
    maskLayer.path = maskPath.CGPath;
    priceView.layer.masksToBounds = true;
    priceView.layer.mask = maskLayer;
    NSArray *buttonsArray = @[self.headerButton_1, self.headerButton_2, self.headerButton_3, self.headerButton_4, self.headerButton_5];
    for (UIButton *button in buttonsArray) {
        [button.layer setCornerRadius:button.bounds.size.width / 2];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

- (IBAction)headButtonClicked:(UIButton *)sender {
    [self.delegate headerButtonClickedWithTag:sender.tag WithIndex:self.tag];
}

- (IBAction)likeButtonClicked:(UIButton *)sender {
    [self.delegate likeButtonClicked:sender withIndex:self.tag];
}

@end
